Vibrate
Definition:
Vibrate([duration])
Description:
Make the mobile device vibrate for a specified time period and in a specified fashion.
Platforms:
All
Parameters:
duration - optional
If set to 0 (zero), the device will not vibrate.
If omitted, the device will vibrate for 1 second.
On Android devices you can specify the duration to vibrate or specify an extended value which defines a vibrating pattern. All times are in milliseconds.
To specify a length of time you want the device to vibrate for, enter a single value specifying the required duration of the vibration.
To specify a vibration pattern, enter a comma separated list of values in the following format:
<vibrationoff>, <vibrationon>, <vibrationoff>, <vibrationon>, …
where <vibrationoff> specifies a period of non-vibration and <vibrationon> specifies a period of vibration. Each parameter should be an integer value specifying a time period in milliseconds. For example, specifying 0,1000,500,1000 would start vibrating immediately for 1 second then stop for half a second and then vibrate again for 1 second, whereas specifying 500, 500, 500, 500, 500, 500, 500, 500 would wait for half a second then turn the vibrator on and off 4 times at half second intervals, with each period of vibration lasting half a second as well.
On iOS devices if this parameter is set to a value greater than zero, the device will vibrate for one second, whatever the value specified.
On the Windows Universal Platform you can specify a maximum value of 5000 milliseconds.
Returns:
nothing
Notes:
This Method will only work on devices which support vibration.
On Apple devices, if vibration is disabled, this Method will not enable vibration and the device will not vibrate.